package com.bit.cfdi.web.domain;


import static javax.persistence.GenerationType.IDENTITY;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "concepto_parte")
public class ConceptoParte implements Serializable {

	private static final long serialVersionUID = 1L;
	
	// Fields
	private Long idConceptoParte;
	private Concepto concepto;
	private Concepto parte;
	private Double cantidad;
	private Integer status;
	
	public static int CONCEPTO_PARTE_VIGENTE= 0;
	public static int CONCEPTO_PARTE_CANCELADA= 1;
	public static int CONCEPTO_PARTE_ELIMINADA= 2;
	
	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id_concepto_parte", nullable = false)
	public Long getIdConceptoParte() {
		return idConceptoParte;
	}
	
	public void setIdConceptoParte(Long idConceptoParte) {
		this.idConceptoParte = idConceptoParte;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_concepto", nullable = false)
	public Concepto getConcepto() {
		return concepto;
	}
	
	public void setConcepto(Concepto concepto) {
		this.concepto = concepto;
	}
	
	@ManyToOne(fetch = FetchType.EAGER) 
    @JoinColumn(name="id_parte", nullable = false) 
	public Concepto getParte() {
		return parte;
	}
	
	public void setParte(Concepto parte) {
		this.parte = parte;
	}
	
	@Column(name = "cantidad", precision = 1000, scale = 6, nullable = false)
	public Double getCantidad() {
		return cantidad;
	}
	
	public void setCantidad(Double cantidad) {
		this.cantidad = cantidad;
	}
	
	@Column(name = "status")
	public Integer getStatus() {
		return this.status;
	}
	
	public void setStatus(Integer status) {
		this.status = status;
	}
	
}
